package com.vincent.sciinfo.controller;

import com.vincent.sciinfo.pojo.LoginCount;
import com.vincent.sciinfo.pojo.User;
import com.vincent.sciinfo.service.LoginCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/loginCount")
public class LoginCountController {

    @Autowired
    private LoginCountService loginCountServer;

    @RequestMapping("/checkUserCountNum")
    public int checkUserCountNum(@RequestBody User user) {
        return loginCountServer.checkUserCountNum(user);
    }

    @RequestMapping("/showLoginCountData")
    public List<LoginCount> showLoginCountData(){
        return loginCountServer.showLoginCountData();
    }
}
